$colors: (
  orange: #D94F00,
  lightgrey: #F7F7F7,
  lightergrey: #FBFBFB,
  darkgrey: #3C3C3B,
  bordergrey: #E5E5E5,
);

$zindex: (
  header: 2,
  footer: 2,
  main: 1,
  sidebar: 3,
);

// format dashboard widget headers
.widgetdiv {
    .content-box-head {
        background: #E8E8E8 !important;
        color: map-get($colors, darkgrey) !important;
        padding-bottom: 1px !important;
        padding-top:  1px !important;
        padding-right: 1px !important;
        padding-left: 5px !important;
        min-height: 25px !important;

        .btn-group {
            .btn {
                color: map-get($colors, darkgrey) !important;
                background: #E8E8E8 !important;
                border: 0px;
                .glyphicon {
                    color: map-get($colors, darkgrey) !important;
                }
            }
        }
        .list-inline {
            li > h3 {
                padding-top: 4px;
            }
        }
    }
}

@font-face {
  font-family: 'SourceSansProBold';
  src: url('/ui/themes/opnsense/build/fonts/SourceSansPro-Bold/SourceSansPro-Bold.woff') format('woff'),
       url('/ui/themes/opnsense/build/fonts/SourceSansPro-Bold/SourceSansPro-Bold.ttf') format('truetype');
}

@font-face {
  font-family: 'SourceSansProSemibold';
  src: url('/ui/themes/opnsense/build/fonts/SourceSansPro-Semibold/SourceSansPro-Semibold.woff') format('woff'),
       url('/ui/themes/opnsense/build/fonts/SourceSansPro-Semibold/SourceSansPro-Semibold.ttf') format('truetype');
}

@font-face {
  font-family: 'SourceSansProRegular';
  src: url('/ui/themes/opnsense/build/fonts/SourceSansPro-Regular/SourceSansPro-Regular.woff') format('woff'),
       url('/ui/themes/opnsense/build/fonts/SourceSansPro-Regular/SourceSansPro-Regular.ttf') format('truetype');
}

// Core variables and mixins
@import "bootstrap/variables";
@import "bootstrap/mixins";

// Reset and dependencies
@import "bootstrap/normalize";
@import "bootstrap/print";
@import "bootstrap/glyphicons";

// Core CSS
@import "bootstrap/scaffolding";
@import "bootstrap/type";
@import "bootstrap/code";
@import "bootstrap/grid";
@import "bootstrap/tables";
@import "bootstrap/forms";
@import "bootstrap/buttons";

// Components
@import "bootstrap/component-animations";
@import "bootstrap/dropdowns";
@import "bootstrap/button-groups";
@import "bootstrap/input-groups";
@import "bootstrap/navs";
@import "bootstrap/navbar";
@import "bootstrap/breadcrumbs";
@import "bootstrap/pagination";
@import "bootstrap/pager";
@import "bootstrap/labels";
@import "bootstrap/badges";
@import "bootstrap/jumbotron";
@import "bootstrap/thumbnails";
@import "bootstrap/alerts";
@import "bootstrap/progress-bars";
@import "bootstrap/media";
@import "bootstrap/list-group";
@import "bootstrap/panels";
@import "bootstrap/responsive-embed";
@import "bootstrap/wells";
@import "bootstrap/close";

// Components w/ JavaScript
@import "bootstrap/modals";
@import "bootstrap/tooltip";
@import "bootstrap/popovers";
@import "bootstrap/carousel";

// Utility classes
@import "bootstrap/utilities";
@import "bootstrap/responsive-utilities";

*{
    -webkit-font-smoothing: antialiased;
}

html, body{
  height: 100%;
  font-family: 'SourceSansProRegular';
  background-color: #FFF;
}

body{
  touch-action: manipulation;
  min-width: 320px;
}

.widget-sort-handle {
  touch-action: none; }

.page-head{
  background: map-get($colors, darkgrey);
  top: 0;
  left: 0;
  position: fixed;
  width: 100%;
  z-index: map-get($zindex, header);
}

.page-content{
  height: calc(100% - 52px);
  padding-top: 52px;
  position: relative;
  z-index: map-get($zindex, main);

  > .row{
    height: 100%;
  }
}

.page-content-head{
  background: map-get($colors, lightergrey);
  border-bottom: 1px solid rgba(#D9D9D9, .50);
  padding-bottom: 15px;
  padding-top: 20px;

  .navbar-nav{
    width: 100%;
  }

  h1,h2,h3{
    line-height: 1;
    margin: 0;
  }
}

.page-content-main{
  background: map-get($colors, lightgrey);
  min-height: calc(100% - 64px);
  padding: 15px 0 (15px + 58px);
}

.page-side{
  background: #FFF;
  border-right: 1px solid rgba(0,0,0,.15);
  height: 100% !important;
  height: calc(100% - 52px) !important;
  left: 0;
  overflow: auto;
  margin-top: 52px;
  position: fixed;
  top: 0;
  z-index: map-get($zindex, sidebar);

  @extend .hidden-xs;
}

.page-side-nav {

  &--active{
    background: map-get($colors, lightgrey);
    border-left: 3px solid map-get($colors, orange);
  }
}

.page-foot{
  background: map-get($colors, lightergrey);
  bottom: 0;
  border-top: 1px solid rgba(#D9D9D9, .50);
  font-size: 12px;
  padding: 20px 0;
  position: fixed;
  width: 100%;
  z-index: map-get($zindex, footer);
}

.content-box{
  background: #FFF;
  border: 1px solid map-get($colors, bordergrey);;

  @extend .clearfix;

  &-head{
  @extend .page-content-head;
  }

  &-main{
  //background: map-get($colors, lightgrey);
  padding-bottom: 15px;
  padding-top: 15px;
  }
}

div.content-box.wizard {
    div {
        img {
            filter:invert(25%);
        }
    }
}

.tab-content{
  border-top: 0px;
  padding: 0px 0;

  > .tab-content{
  margin-bottom: 0;
  padding: 0 15px;
  }

  .tab-content:last-child{
  margin-bottom: 0;
  }
}

.page-content-main section[class^="col-"] + section[class^="col-"]{
  padding-top: ($grid-gutter-width/2);
}

.brand-logo{
    display: none;

    @media (min-width: $screen-sm-min) {
        display: inline-block;
    }
}

.brand-icon{
    display: inline-block;

    @media (min-width: $screen-sm-min) {
        display: none;
    }
}

.col-sm-disable-spacer{
    @media (min-width: $screen-sm-min) {
        padding-top: 0 !important;
    }
}

.col-md-disable-spacer{
    @media (min-width: $screen-md-min) {
        padding-top: 0 !important;
    }
}

.col-lg-disable-spacer{
    @media (min-width: $screen-lg-min) {
        padding-top: 0 !important;
    }
}

.page-login{
    background: map-get($colors, lightgrey);

    .container{
        min-height: 100%;
        margin-bottom: -60px;

        &:after{
            height: 60px;
        }
    }
}

.login-foot{
    font-size: 12px;
}

.login-modal{

    &-container{
        background: #FFF;
        border: 1px solid map-get($colors, bordergrey);
        max-width: 400px;
        margin: 100px auto 15px auto;
    }

    &-head{
        background: map-get($colors, darkgrey);
        height: 75px;
        padding: 0 20px;
    }

    &-content{
        padding: 20px 20px 20px 20px;
    }

    &-foot{
        background: map-get($colors, lightgrey);
        border-top: 1px solid map-get($colors, bordergrey);
        height: 60px;
        padding: 20px 20px 0 20px;

        a{
            color: #7D7D7D;
            text-decoration: none;

            &:hover{
                color: darken(#7D7D7D, 10%);
                text-decoration: underline;
            }
        }
    }
}

.list-inline .btn-group-container{
    @media (min-width:$screen-sm-min){
        float:right;
    }
}

.btn.btn-fixed{
    max-width: 174px;
    width: 100%;
}

.progress-bar-placeholder{
    font-size: 12px;
    position: absolute;
    text-align: center;
    width: 100%;
    z-index: 1;
}

/* BOOTSTRAP EDIT */
.list-group-item{
  border-left: none;
  border-right: none;

  &.collapsed .caret{
    border-bottom: 4px solid green;
    border-top: 0;
  }
}

/* COLLAPSE SIDEBAR */

main.page-content.col-lg-12 {
  padding-left: 90px;
}

#navigation.col-sidebar-left {
  width: 70px;
  overflow: hidden;
  background-color: transparent !important;
  border: none !important;
  > div {
    &.row {
      height: 100% !important;
      > nav.page-side-nav {
        width: 70px;
        height: 100% !important;
        border-right: 1px solid #D9D9D9;
      }
    }
    > nav > #mainmenu > div > {
      a.list-group-item {
        font-size: 14px;
        text-align: center;
        width: 70px;
        height: 70px;
        padding-left: 0px;
        padding-right: 0px;
        padding-top: 12px;
        border-bottom: 2px solid #lightergrey;
        border-right: 1px solid #D9D9D9;
        > span {
          &.fa, &.glyphicon {
            visibility: visible;
            font-size: 20px;
          }
          &.__iconspacer {
            width: 50px;
            height: 30px;
            padding: 0px;
          }
        }
      }
      div {
        &.collapsing > a.list-group-item {
          padding-left: 10px !important;
          font-size: 14px !important;
          display: block !important;
          position: absolute !important;
          left: 70px !important;
        }
        &.collapse {
          &.in {
            > {
              div.collapsing > a.list-group-item {
                padding-left: 10px !important;
                font-size: 14px !important;
                display: block !important;
                position: absolute !important;
                left: 166px !important;
              }
              a.list-group-item, div.collapse.in > a.list-group-item {
                background-color: #fff !important;
              }
            }
            > div.collapse.in > a.list-group-item {
              padding-left: 10px !important;
              font-size: 14px !important;
            }
          }
          > {
            div.collapse > a.list-group-item, a.list-group-item {
              padding-left: 10px !important;
              font-size: 14px !important;
            }
          }
        }
        &.collapsed > a.list-group-item {
          padding-left: 10px !important;
          font-size: 14px !important;
        }
        &.collapse {
          > {
            a.list-group-item, div.collapse > a.list-group-item {
              padding: 3px 8px !important;
            }
          }
          &.in {
            width: 168px;
            font-size: 14px;
            z-index: 10;
            position: absolute;
            left: 70px;
            margin-top: -70px;
            border: 1px solid #eaeaea;
            -webkit-box-shadow: 2px 2px 1px 0px rgba(234, 234, 234, 0.5);
            -moz-box-shadow: 2px 2px 1px 0px rgba(234, 234, 234, 0.5);
            box-shadow: 2px 2px 1px 0px rgba(234, 234, 234, 0.5);
            > div.collapse.in {
              width: 168px;
              font-size: 14px;
              z-index: 10;
              position: absolute;
              left: 166px;
              margin-top: -26px;
              border: 1px solid #eaeaea;
              -webkit-box-shadow: 2px 2px 1px 0px rgba(234, 234, 234, 0.5);
              -moz-box-shadow: 2px 2px 1px 0px rgba(234, 234, 234, 0.5);
              box-shadow: 2px 2px 1px 0px rgba(234, 234, 234, 0.5);
            }
          }
        }
        &.collapsing, &.collapse.in > div.collapsing {
          display: none;
        }
      }
    }
  }
}

button.toggle-sidebar {
  color: #FFF;
  background-color: transparent;
  font-size: 14px;
  border: none;
  margin-top: 18px;
  float: left;
  outline: none;
}

/* COLLAPSE SIDEBAR END*/

#navigation.collapse.in{
    display: block !important;
}

.list-group-submenu .list-group-item:last-child,
.collapse .list-group-item:last-child {
  border-bottom: none;
}

ul.nav > li.dropdown > ul.dropdown-menu > li > a {
  padding: 3px 10px;
}

.nav-tabs {
  margin-right: 1px;
  border-bottom: 1px solid darken(map-get($colors, bordergrey), 30%);
}

.nav-tabs > li {
  border-radius: 0px;
  border-top-right-radius: 10px;
  margin-right: 2px;
}

.nav-tabs > li > a {
  background: #FBFBFB;
  border-radius: 0px;
  border-top-right-radius: 10px;
  margin-right: 0px;
}

.nav-tabs > li > a,
.nav-tabs > li > a:hover,
.nav-tabs > li > a:focus {
  border-right: 1px solid darken(#FBFBFB, 5%);
  border-top: 1px solid darken(#FBFBFB, 5%);
  border-left: 1px solid darken(#FBFBFB, 5%);
  border-bottom: 1px solid darken(map-get($colors, bordergrey), 30%);
}

.nav-tabs > li.active > a {
  background: #FFF !important;
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
  border-right: 1px solid darken(map-get($colors, bordergrey), 30%);
  border-top: 1px solid darken(map-get($colors, bordergrey), 30%);
  border-left: 1px solid darken(map-get($colors, bordergrey), 30%);
}

.nav-tabs > li > a.visible-lg-inline-block:not(.pull-right) {
  border-top-right-radius: 0px !important;
  padding-left: 10px !important;
  padding-right: 5px !important;
}

.nav-tabs > li > a.visible-lg-inline-block.pull-right {
  border-left: 0px !important;
  padding-left: 5px !important;
  padding-right: 10px !important;
}


.nav-tabs.nav-justified{
  border-right:1px solid map-get($colors, bordergrey);
  > li {
    border-bottom:1px solid map-get($colors, bordergrey);
    border-top:1px solid map-get($colors, bordergrey);
    border-left:1px solid map-get($colors, bordergrey);
    border-radius: 0px;
    background: map-get($colors, lightgrey);
  > a {
    color: map-get($colors, darkgrey);
    font-family: 'SourceSansProSemibold';

    @media (min-width:$screen-sm-min){
    border-bottom: 1px solid transparent;
  }
  }
  }

  > li.active > a{
  @media (max-width:$screen-xs-max){
    border-right: 0 !important;
  }
  }
  }

  > li.active + li > a{
  @media (min-width:$screen-sm-min){
    border-left: 1px solid transparent;
  }
  }

  > li:last-child > a{
    border-right:1px solid transparent !important;

    @media (max-width:$screen-xs-max){
    margin-bottom: 0;
  }
  }

.btn .glyphicon {
    vertical-align: -1px;
}

.btn-default .glyphicon {
    color: #757575;
}

table{
    width: 100%;
}

.table {
    margin-bottom: 0px !important;
}

.nav-tabs-justified, .nav-tabs.nav-justified {
    .nav-tabs.nav-justified > .active > a:focus {
        border: 0px !important;
    }
}

.table th, strong, b{
    font-family: 'SourceSansProSemibold';
    font-weight: normal;
}

.table > tbody > tr > td:last-child{
    padding-right: 15px;
}

/* helpers */
.__nowrap{
    white-space: nowrap;
}

.__nomb{
    margin-bottom: 0;
}

.__mb{
    margin-bottom: 15px;
}

.__mt{
    margin-top: 15px;
}

.__ml{
    margin-left: 15px;
}

.__mr{
    margin-right: 15px;
}

.__iconspacer{
    padding-right: 10px;
}

#mainmenu .glyphicon{
    vertical-align: -2px;
}

.list-group-item{
    overflow: hidden;
    text-overflow: ellipsis;

    + div.collapse{
        margin-bottom: -1px;
    }

    + div > a{
        padding-left: 44px;
    }

    &:before{
        background: #D94F00;
        content: "";
        height: 42px;
        min-height: 100%;
        left: 0;
        position: absolute;
        top: 0px;
        width: 0;

        -webkit-transition: width .2s;
        -moz-transition: width .2s;
        -o-transition: width .2s;
        transition: width .2s;

    }

}

.list-group-submenu a{
    padding-left: 56px;
}

.active-menu-title, .active-menu a{
    text-decoration: none;
    position: relative;
    background-color: #F5F5F5;

    &:before{
        width: 3px;
    }

    &.active{
        background-color: #E8E8E8;
    }
}

.active-menu a:before{
    background: #ED9A50;
}

.alert.alert-danger{
    color: #FFF !important;
}

.nav-tabs-justified>li>a, .nav-tabs.nav-justified>li>a{
    border-radius: 0 !important;
}

.navbar-brand{
    padding: 10px 20px;
}

.label-opnsense {
  /* emulates btn */
  border: 1px solid transparent;
  display: inline-block;
  vertical-align: middle;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 3px;
}

.label-opnsense-sm {
  /* emulates btn-sm */
  padding: 5px 10px;
}

.label-opnsense-xs,
.btn-xs {
  /* emulates btn-xs */
  padding: 1px 3px;
}

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-button {
  width: 8px;
  height:5px;
}
::-webkit-scrollbar-track {
  background: #f7f7f7;
  box-shadow: 0px 0px 0px;
  border-radius:0;
}
::-webkit-scrollbar-thumb {
  background: #e5e5e5;
  border: thin solid #e5e5e5;
  border-radius: 0px;
}
::-webkit-scrollbar-thumb:hover {
  background:#e5e5e5;
}

.widgetdiv {
    padding-top:0px !important;
    padding-bottom:20px;
}

select {
  overflow: hidden;
  border: 1px solid #ccc;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  background-repeat: no-repeat;
  background-position: right;
  background-image: url(/ui/themes/opnsense/build/images/caret.png) !important;}

#grid-log th[data-column-id="__timestamp__"],
#filter-log-entries th[data-column-id="__timestamp__"] {
  min-width: 3.5em;
}

.table-responsive {
  @media screen and (max-width: $screen-xs-max) {
    margin-bottom: 0;
    > .table {
      > thead,
      > tbody,
      > tfoot {
        > tr {
          > th,
          > td {
            white-space: normal;
          }
        }
      }
    }
  }
}

label>input[type="checkbox"],
label>input[type="radio"] {
  margin-right: .4em;
  float:left;
}

div[data-for*="help_for"] {
  padding-top: .4em;
}

#log-settings label[for^="act"] {
  margin-right: 1.5em;
}

#log-settings table>tbody>tr>td {
  vertical-align: middle;
}

#log-settings select#filterlogentries,
#log-settings select#filterlogentriesupdateinterval {
  width: 5em;
}

#log-settings select#filterlogentriesinterfaces {
  min-width: 100%;
  max-width: 100%;
}

/* fields in firewall schedule */
[data-state="lightcoral"] {
  background-color: lightcoral;
}
[data-state="white"] {
  background-color: white;
}
[data-state="red"] {
  background-color: red;
}

.tokens-container {
  margin-top: 0px;
  margin-bottom: 0px;
}
